﻿﻿﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="favicon.ico">
    <link rel="Shortcut Icon" href="favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="vue/Vue.v2.6.12.js"></script>
    <script type="text/javascript" src="js/HttpUtil.js"></script>
    <script type="text/javascript" src="js/admin.check.login.js"></script>
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>

    <link rel="stylesheet" href="css/layui.css" media="all">
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--/meta 作为公共模版分离出去-->

    <title>资讯列表 - 资讯管理 - H-ui.admin v3.0</title>
    <meta name="keywords" content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
    <meta name="description" content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<!--_header 作为公共模版分离出去-->
<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container-fluid cl">
            <a class="logo navbar-logo f-l mr-10 hidden-xs" href="/aboutHui.shtml">H-ui.admin</a>
            <a class="logo navbar-logo-m f-l mr-10 visible-xs" href="/aboutHui.shtml">H-ui</a>
            <span class="logo navbar-slogan f-l mr-10 hidden-xs">v3.0</span>
            <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
            <nav class="nav navbar-nav">
                <ul class="cl">
                    <li class="dropDown dropDown_hover">
                        <a href="javascript:;" class="dropDown_A"><i class="Hui-iconfont">&#xe600;</i> 新增 <i
                                class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li>
                                <a href="javascript:;" onclick="article_add('添加资讯','article-add.html')"><i
                                        class="Hui-iconfont">&#xe616;</i> 资讯</a>
                            </li>
                            <li>
                                <a href="javascript:;" onclick="picture_add('添加资讯','picture-add.html')"><i
                                        class="Hui-iconfont">&#xe613;</i> 图片</a>
                            </li>
                            <li>
                                <a href="javascript:;" onclick="product_add('添加资讯','product-add.html')"><i
                                        class="Hui-iconfont">&#xe620;</i> 产品</a>
                            </li>
                            <li>
                                <a href="javascript:;" onclick="member_add('添加用户','member-add.html','','510')"><i
                                        class="Hui-iconfont">&#xe60d;</i> 用户</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
            <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                <ul class="cl">
                    <li>超级管理员</li>
                    <li class="dropDown dropDown_hover">
                        <a href="#" class="dropDown_A">admin <i class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" onClick="myselfinfo()">个人信息</a></li>
                            <li>
                                <a href="#">切换账户</a>
                            </li>
                            <li>
                                <a href="#">退出</a>
                            </li>
                        </ul>
                    </li>
                    <li id="Hui-msg">
                        <a href="#" title="消息">
                            <span class="badge badge-danger">1</span>
                            <i class="Hui-iconfont" style="font-size:18px">&#xe68a;</i></a>
                    </li>
                    <li id="Hui-skin" class="dropDown right dropDown_hover">
                        <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont"
                                                                                style="font-size:18px">&#xe62a;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li>
                                <a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a>
                            </li>
                            <li>
                                <a href="javascript:;" data-val="blue" title="蓝色">蓝色</a>
                            </li>
                            <li>
                                <a href="javascript:;" data-val="green" title="绿色">绿色</a>
                            </li>
                            <li>
                                <a href="javascript:;" data-val="red" title="红色">红色</a>
                            </li>
                            <li>
                                <a href="javascript:;" data-val="yellow" title="黄色">黄色</a>
                            </li>
                            <li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<!--/_header 作为公共模版分离出去-->

<!--_menu 作为公共模版分离出去-->
<aside class="Hui-aside">

    <div class="menu_dropdown bk_2">
        <dl id="menu-article">
            <dt class="selected"><i class="Hui-iconfont">&#xe616;</i> 资讯管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
            </dt>
            <dd style="display:block">
                <ul>
                    <li class="current">
                        <a href="article-list.html" title="资讯管理">资讯管理</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-picture">
            <dt><i class="Hui-iconfont">&#xe613;</i> 图片管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="picture-list.html" title="图片管理">图片管理</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-product">
            <dt><i class="Hui-iconfont">&#xe620;</i> 产品管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="product-brand.html" title="品牌管理">品牌管理</a>
                    </li>
                    <li>
                        <a href="product-category.html" title="分类管理">分类管理</a>
                    </li>
                    <li>
                        <a href="product-list.html" title="产品管理">产品管理</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-comments">
            <dt><i class="Hui-iconfont">&#xe622;</i> 评论管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="http://h-ui.duoshuo.com/admin/" title="评论列表">评论列表</a>
                    </li>
                    <li>
                        <a href="feedback-list.html" title="意见反馈">意见反馈</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-member">
            <dt><i class="Hui-iconfont">&#xe60d;</i> 会员管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="member-list.html" title="会员列表">会员列表</a>
                    </li>
                    <li>
                        <a href="member-del.html" title="删除的会员">删除的会员</a>
                    </li>
                    <li>
                        <a href="member-level.html" title="等级管理">等级管理</a>
                    </li>
                    <li>
                        <a href="member-scoreoperation.html" title="积分管理">积分管理</a>
                    </li>
                    <li>
                        <a href="member-record-browse.html" title="浏览记录">浏览记录</a>
                    </li>
                    <li>
                        <a href="member-record-download.html" title="下载记录">下载记录</a>
                    </li>
                    <li>
                        <a href="member-record-share.html" title="分享记录">分享记录</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-admin">
            <dt><i class="Hui-iconfont">&#xe62d;</i> 管理员管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="admin-role.html" title="角色管理">角色管理</a>
                    </li>
                    <li>
                        <a href="admin-permission.html" title="权限管理">权限管理</a>
                    </li>
                    <li>
                        <a href="admin-list.html" title="管理员列表">管理员列表</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-tongji">
            <dt><i class="Hui-iconfont">&#xe61a;</i> 系统统计<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="charts-1.html" title="折线图">折线图</a>
                    </li>
                    <li>
                        <a href="charts-2.html" title="时间轴折线图">时间轴折线图</a>
                    </li>
                    <li>
                        <a href="charts-3.html" title="区域图">区域图</a>
                    </li>
                    <li>
                        <a href="charts-4.html" title="柱状图">柱状图</a>
                    </li>
                    <li>
                        <a href="charts-5.html" title="饼状图">饼状图</a>
                    </li>
                    <li>
                        <a href="charts-6.html" title="3D柱状图">3D柱状图</a>
                    </li>
                    <li>
                        <a href="charts-7.html" title="3D饼状图">3D饼状图</a>
                    </li>
                </ul>
            </dd>
        </dl>
        <dl id="menu-system">
            <dt><i class="Hui-iconfont">&#xe62e;</i> 系统管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i></dt>
            <dd>
                <ul>
                    <li>
                        <a href="system-base.html" title="系统设置">系统设置</a>
                    </li>
                    <li>
                        <a href="system-category.html" title="栏目管理">栏目管理</a>
                    </li>
                    <li>
                        <a href="system-data.html" title="数据字典">数据字典</a>
                    </li>
                    <li>
                        <a href="system-shielding.html" title="屏蔽词">屏蔽词</a>
                    </li>
                    <li>
                        <a href="system-log.html" title="系统日志">系统日志</a>
                    </li>
                </ul>
            </dd>
        </dl>
    </div>
</aside>
<div class="dislpayArrow hidden-xs">
    <a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a>
</div>
<!--/_menu 作为公共模版分离出去-->

<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        资讯管理
        <span class="c-gray en">&gt;</span>
        资讯列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <div class="Hui-article" id="vue-Hui">
        <article class="cl pd-20">
            <div class="text-c">
				<span class="select-box inline">
				<select name="searchType" class="select" v-model="searchType">
					<option value="">全部栏目</option>
					<option value="1">新闻资讯</option>
					<option value="2">行业动态</option>
					<option value="3">行业资讯</option>
					<option value="4">行业新闻</option>
				</select>
				</span>
                <input type="text" name="" id="search" v-model="search" placeholder=" 资讯名称" style="width:250px"
                       class="input-text">
                <button name="" id="" class="btn btn-success" @click="search_button"><i
                        class="Hui-iconfont">&#xe665;</i> 搜资讯
                </button>
            </div>
            <div class="cl pd-5 bg-1 bk-gray mt-20">
				<span class="l">
				<a href="javascript:;" @click="deleteAll()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
				<a class="btn btn-primary radius" data-title="添加资讯" _href="article-add.html"
                   onclick="article_add('添加资讯','article-add.html')" href="javascript:;"><i
                        class="Hui-iconfont">&#xe600;</i> 添加资讯</a>
				</span>
                <span class="r">共有数据：<strong>{{amount}}</strong> 条</span>
            </div>
            <div class="mt-20">
                <table class="table table-border table-bordered table-bg table-hover">
                    <thead>
                    <tr class="text-c">
                        <th width="25"><input type="checkbox" name="" value="" v-model="checkAll"
                                              @change="checkAllChange()"></th>
                        <th width="80">ID</th>
                        <th width="120">标题</th>
                        <th width="80">图片</th>
                        <th width="80">分类</th>
                        <th width="80">来源</th>
                        <th width="120">创建时间</th>
                        <!--                        <th width="120">更新时间</th>-->
                        <th width="75">浏览次数</th>
                        <th width="60">发布状态</th>
                        <th width="120">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="text-c" v-for="(article,i) in list" :key="i">
                        <td><input type="checkbox"
                                   v-model="article.check" @change="curChange(article.informationId)" name=""></td>
                        <td style="height: 80px">{{article.informationId}}</td>
                        <td class="text-l"><u style="cursor:pointer" class="text-primary"
                                              @click="article_addView(article.informationId,article.viewCount)"
                                              title="查看">{{article.title}}</u></td>
                        <td>
                            <div v-if="article.urlImg != ''">
                                <img :src=ma+article.urlImg style="width: 120px;height: 80px">
                            </div>
                            <div v-if="article.urlImg == ''">
                                暂无
                            </div>
                        </td>
                        <td>
                            <div v-if="article.categoryId==0">
                                全部栏目
                            </div>
                            <div v-if="article.categoryId==1">
                                新闻资讯
                            </div>
                            <div v-if="article.categoryId==2">
                                行业动态
                            </div>
                            <div v-if="article.categoryId==3">
                                行业资讯
                            </div>
                            <div v-if="article.categoryId==4">
                                行业新闻
                            </div>
                        </td>

                        <td>{{article.articleSource}}</td>
                        <td>{{article.createTime}}</td>
                        <td>{{article.viewCount}}</td>
                        <td class="td-status">
                            <div v-if="article.statusType==0">
                                <span class="label label-success radius">草稿</span>
                            </div>
                            <div v-if="article.statusType==1">
                                <span class="label label-success radius">已发布</span>
                            </div>
                            <div v-if="article.statusType==2">
                                <span class="label label-success radius">待发布</span>
                            </div>
                            <div v-if="article.statusType==3">
                                <span class="label label-dange radius">未通过</span>
                            </div>
                            <div v-if="article.statusType==4">
                                <span class="label label-default radius">待审核</span>
                            </div>
                            <div v-if="article.statusType==5">
                                <span class="label label-defaunt radius">已下架</span>
                            </div>
                        </td>
                        <td class="f-14 td-manage">
                            <div v-if="article.statusType==0">
                                <a style="text-decoration:none"
                                   @click="articleCheck(this,article.informationId)" href="javascript:;"
                                   title="审核">审核</a>
                                <a style="text-decoration:none" class="ml-5"
                                   @click="article_edit('资讯编辑','article-add.html',article.informationId)"
                                   href="javascript:;"
                                   title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   href="javascript:;" title="删除" @click="deleteById(article.informationId)">
                                    <i class="Hui-iconfont">&#xe6e2;</i></a>
                                <span class="layui-icon" title="下载图片" @click="viewImg(article.urlImg)">&#xe601;</span>
                            </div>
                            <div v-if="article.statusType==1">
                                <a style="text-decoration:none" @click="articleShiftOut(this,article.informationId)"
                                   href="javascript:;" title="下架"><i
                                        class="Hui-iconfont">&#xe6de;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   @click="article_edit('资讯编辑','article-add.html',article.informationId)"
                                   href="javascript:;"
                                   title="编辑"><i
                                        class="Hui-iconfont">&#xe6df;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   href="javascript:;" title="删除" @click="deleteById(article.informationId)"><i
                                        class="Hui-iconfont">&#xe6e2;</i></a>
                                <span class="layui-icon" title="下载图片" @click="viewImg(article.urlImg)">&#xe601;</span>
                            </div>
                            <div v-if="article.statusType==2">
                                <a style="text-decoration:none"
                                   @click="articlePublish(this,article.informationId)" href="javascript:;"
                                   title="待发布">申请上线</a>
                                <a style="text-decoration:none" class="ml-5"
                                   @click="article_edit('资讯编辑','article-add.html',article.informationId)"
                                   href="javascript:;"
                                   title="编辑"><i
                                        class="Hui-iconfont">&#xe6df;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   href="javascript:;" title="删除" @click="deleteById(article.informationId)"><i
                                        class="Hui-iconfont">&#xe6e2;</i></a>
                                <span class="layui-icon" title="下载图片" @click="viewImg(article.urlImg)">&#xe601;</span>
                            </div>
                            <div v-if="article.statusType==3">
                                <a style="text-decoration:none"
                                   @click="articleApplication(this,article.informationId)" href="javascript:;"
                                   title="未通过">重新申请</a>
                                <a style="text-decoration:none" class="ml-5"
                                   @click="article_edit('资讯编辑','article-add.html',article.informationId)"
                                   href="javascript:;"
                                   title="编辑"><i
                                        class="Hui-iconfont">&#xe6df;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   href="javascript:;" title="删除" @click="deleteById(article.informationId)"><i
                                        class="Hui-iconfont">&#xe6e2;</i></a>
                                <span class="layui-icon" title="下载图片" @click="viewImg(article.urlImg)">&#xe601;</span>
                            </div>
                            <div v-if="article.statusType==4">
                                <a style="text-decoration:none"
                                   @click="articleApplication(this,article.informationId)" href="javascript:;"
                                   title="待审核"></a>
                            </div>
                            <div v-if="article.statusType==5">
                                <a style="text-decoration:none"
                                   @click="articlePublish(this,article.informationId)" href="javascript:;"
                                   title="重新发布"><i class="Hui-iconfont">&#xe603;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   @click="article_edit('资讯编辑','article-add.html',article.informationId)"
                                   href="javascript:;"
                                   title="编辑"><i
                                        class="Hui-iconfont">&#xe6df;</i></a>
                                <a style="text-decoration:none" class="ml-5"
                                   href="javascript:;" title="删除" @click="deleteById(article.informationId)"><i
                                        class="Hui-iconfont">&#xe6e2;</i></a>
                                <a class="layui-icon" title="下载图片" @click="viewImg(article.urlImg)">&#xe601;</a>
                            </div>
                        </td>
                    </tr>
                    </tbody>
                </table>
                    <!--图片放大 模态框（Modal） -->
                    <!--<div class="modal fade text-center" id="imgZoomInModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog" style="display: inline-block; width: auto;">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times; </button>
                                </div>
                                <div class="modal-body">
                                    <img src="" id="pigImg" />
                                </div>
                            </div>
                            &lt;!&ndash; /.modal-content &ndash;&gt;
                        </div>
                        &lt;!&ndash; /.modal &ndash;&gt;
                    </div>-->
    </div>
            每页显示<select name="" size="1" v-model="per">
            <option value="5">5条数据</option>
            <option value="7">7条数据</option>
            <option value="10">10条数据</option>
        </select>
            当前第{{pareee}}/{{counts}}页
            <input type="button" value="首页" @click="indexPage()">
            <input type="button" value="上一页" @click="previousPage()">
            <input type="button" value="下一页" @click="nextPage()">
            <input type="button" value="尾页" @click="trailerPage()">
        </article>
    </div>
</section>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.page.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="dist/excel-bootstrap-table-filter-bundle.js"></script>
<!--<link href="css/bootstrap.min.css" rel="stylesheet">-->
<script type="text/javascript">

    $('.table-sort').dataTable({
        "aaSorting": [[1, "desc"]],//默认第几个排序
        "bStateSave": true,//状态保存
        "aoColumnDefs": [
            //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
            {"orderable": false, "aTargets": [0, 8]}// 不参与排序的列
        ]
    });

    /*资讯-添加*/
    function article_add(title, url, w, h) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }


    let vue = new Vue({
        el: '#vue-Hui',
        data: {
            list: [],           //所有数据集合
            ma: "http://localhost:80/merchant_api/imgDo/fileDownload?id=",   //图片地址
            checkAll: false,    //全选的状态
            checkBox: [],        //复选框选择
            search: "",          //搜索输入
            searchType: "",      //搜索类型

            amount: "",          //总数据
            per: 7,             //显示数据
            counts: "",          //总页数页数
            pareee: 1,          //当前页数
        },
        methods: {
            //显示列表数据
            showList: function () {
                if (this.pareee > this.counts) {
                    this.pareee = this.pareee - 1;
                }
                let url = "information/pagingInformation.do";
                let params = {newPages: this.pareee, pages: this.per};
                this.checkAll = false;
                let thisM = this;
                postWithJson(url, params, function (data) {
                    //展示商品列表数据
                    thisM.list = data;
                });
            },
            //删除资讯
            deleteById: function (article) {
                let thisObj = this;
                layer.confirm("你确定要删除么？", function (index) {
                    thisObj.deletePackage(article)
                });
            },
            //审核 check
            articleCheck: function (obj, id) {
                let thisObj = this;
                console.log("articleCheck" + id);
                layer.confirm('审核文章？', {
                        btn: ['通过', '不通过', '取消'],
                        shade: false,
                        closeBtn: 0
                    },
                    function () {
                        $(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" @click="articlePublish(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
                        let url = 'information/updateStatusByIdInformation.do';
                        let params = {informationId: id, statusType: 2}
                        postWithJson(url, params, function (data) {
                            thisObj.showList();
                        });
                        $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">待发布</span>');
                        $(obj).remove();
                        layer.msg('已审核', {icon: 6, time: 1000});
                    },
                    function () {
                        $(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" @click="articleApplication(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
                        let url = 'information/updateStatusByIdInformation.do';
                        let params = {informationId: id, statusType: 3}
                        postWithJson(url, params, function (data) {
                            thisObj.showList();
                        });
                        $(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
                        $(obj).remove();
                        layer.msg('未通过', {icon: 5, time: 1000});
                    });

            },
            /*资讯-发布*/
            articlePublish: function (obj, id) {
                let thisObj = this;
                layer.confirm('确认要发布吗？', function (index) {
                    $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" @click="articleShiftOut(this,id)" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6de;</i></a>');
                    let url = 'information/updateStatusByIdInformation.do';
                    let params = {informationId: id, statusType: 1}
                    postWithJson(url, params, function () {
                        thisObj.showList();
                    });
                    $(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
                    $(obj).remove();
                    layer.msg('已发布!', {icon: 6, time: 1000});
                });
            },
            /*资讯-重新申请*/
            articleApplication: function (obj, id) {
                let thisObj = this;
                $(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">待审核</span>');
                let url = 'information/updateStatusByIdInformation.do';
                let params = {informationId: id, statusType: 4}
                postWithJson(url, params, function () {
                    thisObj.showList();
                });
                $(obj).parents("tr").find(".td-manage").html("");
                layer.msg('已提交申请，耐心等待审核!', {icon: 1, time: 2000});
            },
            /*资讯-下架*/
            articleShiftOut: function (obj, id) {
                let thisObj = this;
                layer.confirm('确认要下架吗？', function (index) {
                    $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" @click="articlePublish(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont">&#xe603;</i></a>');
                    let url = 'information/updateStatusByIdInformation.do';
                    let params = {informationId: id, statusType: 5}
                    postWithJson(url, params, function () {
                        thisObj.showList();
                    });
                    $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
                    $(obj).remove();
                    layer.msg('已下架!', {icon: 5, time: 1000});
                });
            },

            //全选
            checkAllChange: function () {
                for (let i = 0; i < this.list.length; i++) {
                    this.list[i].check = this.checkAll;
                }
                ;
            },
            //当前的处理
            curChange: function () {
                //取出打勾的状态  filter()-->对数组进行过滤处理，返回满足条件的数组
                let thisObj = this;
                this.checkAll = this.list.every(function (v) {
                    return v.check;
                })
                //这是一个集合
                let selected = this.list.filter(function (v) {
                    return v.check == true;
                });
                this.checkBox = [];
                for (let i = 0; i < selected.length; i++) {
                    thisObj.checkBox.push(selected[i].informationId)
                }
            },
            //批量删除
            deleteAll: function () {
                let thisObj = this;
                layer.confirm('你确定要删除么？', function () {
                    thisObj.curChange();
                    for (let i = 0; i < thisObj.checkBox.length; i++) {
                        let params = thisObj.checkBox[i];
                        thisObj.deletePackage(params)
                    }
                })
            },

            //浏览次数
            article_addView: function (InformationId, viewCount) {
                let id = InformationId;
                let num = viewCount + 1;
                let thisM = this;
                let url = "information/viewCountInformation.do";
                let params = {informationId: id, viewCount: num}
                console.log(InformationId);
                console.log(num);
                postWithJson(url, params, function (data) {
                    console.log("article_addView" + data)
                    thisM.showList();
                })
            },
            //搜索
            search_button: function () {
                if (this.searchType == "" && this.search == "") {
                    this.indexList();
                    this.MaxPages();
                    return;
                }
                let thisM = this;
                let url = "information/dimSelectListAllInformation.do";
                let params = {title: this.search, categoryId: this.searchType};
                postWithJson(url, params, function (data) {
                    thisM.amount = data.length;
                    thisM.counts = 1;
                    thisM.list = data;
                })
            },
            //编辑
            article_edit: function (title, url, id) {
                /*资讯-编辑*/
                let urlParam = url + "?informationId=" + id;
                var index = layer.open({
                    type: 2,
                    title: title,
                    content: urlParam
                });
                layer.full(index);
            },
            //删除
            deletePackage: function (params) {
                let thisObj = this;
                let url = "information/deleteInformation.do";
                postWithJson(url, params, function () {
                    layer.msg('删除成功');
                    thisObj.listAll();
                    thisObj.showList();
                })
            },

            //计算分页
            MaxPages() {
                let url = "information/selectListInformation.do";
                let thisM = this;
                get(url, function (data) {
                    if (thisM.amount == "") {
                        thisM.amount = data.length;
                    } else {
                        thisM.amount = thisM.amount;
                    }
                    counts = thisM.amount / thisM.per;
                    if (counts != Math.round(counts)) {
                        counts = Math.round(counts);
                    }
                    thisM.counts = counts;
                    thisM.amount = thisM.amount;
                });
            },
            //列表数据
            listAll() {
                let url = "information/selectListInformation.do";
                let thisM = this;
                get(url, function (data) {
                    thisM.amount = data.length;
                    thisM.MaxPages();
                });
            },
            //首页
            indexPage: function () {
                this.pareee = 1;
                this.listAll();
                this.showList();
            },
            //下一页
            nextPage: function () {
                //发起ajax http请求后台获取数据
                let counts = this.counts;
                this.pareee = this.pareee + 1;
                if (this.pareee > counts) {
                    this.pareee = this.pareee - 1;
                    alert("已经是最后一页了!");
                    return;
                }
                this.MaxPages();
                if (counts > Math.ceil(this.amount / this.per)) {
                    console.log("counts" + counts)
                    this.pareee = this.counts;
                }
                this.showList();
            },
            //上一页
            previousPage: function () {
                //发起ajax http请求后台获取数据
                this.pareee = this.pareee - 1;
                if (this.pareee == 0) {
                    this.pareee = this.pareee + 1;
                    alert("已经是最新页了！")
                    return;
                }
                this.MaxPages();
                let counts = this.counts;
                if (this.pareee > counts) {
                    console.log("counts" + counts)
                    this.pareee = this.counts;
                }
                this.showList();

            },
            //尾页
            trailerPage: function () {
                //发起ajax http请求后台获取数据

                this.listAll();
                this.MaxPages();
                let params = counts;
                this.pareee = params;
                this.showList();
            },
            //列表
            indexList: function () {
                this.listAll();
                this.showList();
            },

            //图片展示
            viewImg(sc){
                if (sc == null || sc == ""){
                    layer.msg("图片暂无，亲！")
                    return;
                }
            location.href = this.ma+sc;
            }

        },
        mounted: function () {
            this.indexList();
            this.MaxPages();
        }
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
